require 'ruby_file'

module Evil
  class Action
    def self.constantize(action)
      action_file = File.dirname(__FILE__)+"/actions/#{action}.rb"
      begin
        load action_file
      rescue => e
        p e
      end
      "Evil::#{action.to_s.classify}".constantize
    end

    def initialize(editor)
      @editor = editor
    end
  end

  class RemoteAction
    def initialize(editor, window)
      @editor = editor
      @window = window
    end

    def current_file
      RubyFile.new(@editor.file)
    end
  end

  # temp puts here
  class TestFileNameGenerator
    def test_file_name orig_file_name
      return nil if !orig_file_name
      orig_file_name.scan /(^.*)\.rb/ do |filename|
        return "#{filename}_test.rb"
      end
    end
  end

end
